package behavioral.observer;

/**
 * @Description: 观察者测试类
 * @Author: lxt
 * @CreateDate: 2019/11/1
 **/
public class ObserverTest {
    public static void main(String[] args) {
        Observer xm = new Observer("小明");
        Observer xh = new Observer("小红");
        Observer xq = new Observer("小青");

        Subject subject = new Subject();
        subject.addObserver(xm);
        subject.addObserver(xh);
        subject.addObserver(xq);

        xm.sendMessagge(subject, "今天聚餐吗？");
    }
}
